<template>
  <div class="edit">
    <script id="editor" type="text/plain"></script>
  </div>
</template>
<style>
  .edit{
    width: 1300px;
    height: 300px;
    margin: auto;
  }
</style>

<script>
  import '../../static/UE/ueditor.config.js'
  import '../../static/UE/ueditor.all.min.js'
  import '../../static/UE/lang/zh-cn/zh-cn.js'

  export default {
    name: 'UE',
    data () {
      return {
        editor: null
      }
    },
    props: {

      config: {
        type: Object //嘤嘤怪
      }
    },
    mounted() {
      const _this = this;
      this.editor = UE.getEditor('editor', this.config); // 初始化UE
      this.editor.addListener("ready", function () {

      });
    },
    methods: {
      getUEContent() { // 获取内容方法
        return this.editor.getContent()
      }
    },
    destroyed() {
      this.editor.destroy();
    }
  }
</script>
